package edu.bit.water.service;

import edu.bit.water.dao.WasteWaterSubDao;
import edu.bit.water.entity.MetaLimit;
import edu.bit.water.entity.WasteWaterSub;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WasteWaterSubService {

    @Autowired
    private WasteWaterSubDao wasteWaterSubDao;

    public List<MetaLimit> getMetaData(String stdNumber) {
        return wasteWaterSubDao.getMetaData(stdNumber);
    }

    public List<WasteWaterSub> select(int lastId) {
        return wasteWaterSubDao.select(lastId);
    }

    public void insert(WasteWaterSub wasteWaterSub) {
        wasteWaterSubDao.insert(wasteWaterSub);
    }

    public void update(WasteWaterSub wasteWaterSub) {
        wasteWaterSubDao.update(wasteWaterSub);
    }

    public void delete(List<Integer> ids) {
        for (Integer id : ids) {
            wasteWaterSubDao.delete(id);
        }
    }

    public void updateState(String state, int id) {
        wasteWaterSubDao.updateState(state, id);
    }


}
